
package com.probiz.estore.common.model.order.base;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

import com.probiz.estore.common.model.customer.Customer;
import com.probiz.estore.common.model.order.OrderAddress;
import com.probiz.estore.common.model.sales.PromoRule;
import com.probiz.estore.core.model.BaseObject;

/**
 * SalesOrder Base Java Bean, base class for the model, mapped directly to
 * database table
 * 
 * Avoid changing this file if not necessary, will be overwritten.
 * 
 */
public class SalesOrderTbl extends BaseObject implements Serializable {

	protected Integer		salesOrderId;
	/**
	 * 订单号
	 */
	protected String		orderNo;
	/**
	 * 购买客户账户
	 */
	protected String		customerUsername;
	/**
	 * 购买客户姓名
	 */
	protected String		customerFirstname;
	/**
	 * 购买客户邮件
	 */
	protected String		customerEmail;
	/**
	 * 下单后订单总额=商品金额+包装费+运输费+税费-折扣
	 * totalAmount=productCost+wrapCost+shippingCost+tax-discount
	 */
	protected BigDecimal	totalAmount;
	/**
	 * 已支付金额 注意下单后要考虑（giftCertificatePaid+pointPaid）
	 */
	protected BigDecimal	paidAmount;
	/**
	 * 商品金额
	 */
	protected BigDecimal	productCost;
	/**
	 * 包装费
	 */
	protected BigDecimal	wrapCost;
	/**
	 * 运输费
	 */
	protected BigDecimal	shippingCost;
	/**
	 * 税费
	 */
	protected BigDecimal	tax;
	/**
	 * 折扣
	 */
	protected BigDecimal	discount;
	/**
	 * 礼券支付金额
	 */
	protected BigDecimal	giftCertificatePaid;
	/**
	 * 积分支付的金额
	 */
	protected BigDecimal	pointPaid;
	/**
	 * 使用了的积分
	 */
	protected Integer		usedShopPoint;
	/**
	 * 使用了的优惠券
	 */
	protected String		usedCouponNo;
	/**
	 * 获得的积分
	 */
	protected Integer		gainedPoint;
	/**
	 * 订单结束获得的积分
	 */
	protected Integer		gainedPointAtLast;
	/**
	 * 获得的优惠券活动
	 */
	protected PromoRule		gainedCouponType;
	/**
	 * 订单加价或降价
	 */
	protected BigDecimal	premium;
	/**
	 * 是否款到发货 is Cash on Delivery
	 */
	protected Short			isCod;
	/**
	 * 支付方式id，用于前台支付跳转 与PaymentMethod表的纪录的ID对应
	 */
	protected Integer		paymentMethodId;
	/**
	 * 支付方式类型(货到付款、自提) 1=现金 2=POS刷卡 3=支票
	 */
	protected Short			paymentType;
	/**
	 * 支付方式的描述，例如 "货到付款 现金支付","货到付款 POS刷卡支付","在线支付,银行卡转账","邮局汇款","自提 支票支付"
	 */
	protected String		paymentTypeDesc;
	/**
	 * 是否需要发票
	 */
	protected Short			hasInvoice;
	/**
	 * 发票抬头
	 */
	protected String		invoiceTitle;
	/**
	 * 包装外键，不使用包装即为NULL
	 */
	protected Integer		wrapId;
	/**
	 * 包装名称
	 */
	protected String		wrapName;
	/**
	 * 包装祝福语
	 */
	protected String		wrapNote;
	/**
	 * 客户留言
	 */
	protected String		remark;
	/**
	 * 订单备注
	 */
	protected String		memo;
	/**
	 * 订单作废原因
	 */
	protected String		cancelReason;
	/**
	 * ip地址
	 */
	protected String		ipAddress;
	/**
	 * 标签
	 */
	protected String		tags;
	/**
	 * 运输费率id 
	 */
	protected Integer       shippingRateId;
	/**
	 * 运输方式id
	 */
	protected Integer		shippingMethodId;
	/**
	 * 配送方式描述，例如“货到付款 邮政EMS”，“款到发货 圆通快递”，“自提 中国,广东,广州,先烈中路自提点”等
	 * 
	 */
	protected String		deliveryTypeDesc;
	/**
	 * 送货时间
	 */
	protected String		deliveryTime;
	/**
	 * 是否送货前电话确认
	 */
	protected Short			needConfrimB4Delivery;
	/**
	 * 客户取货中心ID
	 */
	protected Integer		selfCollectionCentreId;
	/**
	 * 客户取货中心名称
	 */
	protected String		selfCollectionCentreName;
	/**
	 * 要求提货日期
	 */
	protected Date			exceptedSelfCollectDate;
	/**
	 * 实际提货日期
	 */
	protected Date			actualSelfCollectDate;
	/**
	 * 订单来源，1-网上订购 2-代客下单
	 */
	protected Short			orderSource;
	/**
	 * 订单基础状态
	 */
	protected Short			orderStatus;
	/**
	 * 支付状态
	 */
	protected Short			paymentStatus;
	/**
	 * 发货状态
	 */
	protected Short			shipmentStatus;
	/**
	 * 1=已打印
	 */
	protected Short			isPrinted;
	protected Date			createTime;
	protected Date			updateTime;
	protected Integer		createBy;
	protected Integer		updateBy;
	protected Integer		version;
	/**
	 * 指向发货地址
	 */
	protected OrderAddress	orderAddress;
	/**
	 * 购买客户 匿名购买则为NULL
	 */
	protected Customer		customer;
	/**
	 * 订单日志集合
	 */
	protected Set			orderAudits		= new HashSet();
	/**
	 * 收退款记录集合
	 */
	protected Set			orderPayments	= new HashSet();
	/**
	 * 订单优惠活动集合
	 */
	protected Set			orderPromotions	= new HashSet();
	/**
	 * 发退货记录集合
	 */
	protected Set			orderShipments	= new HashSet();
	/**
	 * 销售项明细集合
	 */
	protected Set			orderSkus		= new HashSet();

	/**
	 * Default Empty Constructor for class SalesOrder
	 */
	public SalesOrderTbl() {
		super();
	}

	/**
	 * Default Key Fields Constructor for class SalesOrder
	 */
	public SalesOrderTbl(Integer in_salesOrderId) {
		this.setSalesOrderId(in_salesOrderId);
	}

	public OrderAddress getOrderAddress() {
		return orderAddress;
	}

	public void setOrderAddress(OrderAddress in_orderAddress) {
		this.orderAddress = in_orderAddress;
	}

	public Set getOrderAudits() {
		return orderAudits;
	}

	public void setOrderAudits(Set in_orderAudits) {
		this.orderAudits = in_orderAudits;
	}

	public Set getOrderPayments() {
		return orderPayments;
	}

	public void setOrderPayments(Set in_orderPayments) {
		this.orderPayments = in_orderPayments;
	}

	public Set getOrderPromotions() {
		return orderPromotions;
	}

	public void setOrderPromotions(Set in_orderPromotions) {
		this.orderPromotions = in_orderPromotions;
	}

	public Set getOrderShipments() {
		return orderShipments;
	}

	public void setOrderShipments(Set in_orderShipments) {
		this.orderShipments = in_orderShipments;
	}

	public Set getOrderSkus() {
		return orderSkus;
	}

	public void setOrderSkus(Set in_orderSkus) {
		this.orderSkus = in_orderSkus;
	}

	/**
	 * *
	 * 
	 * @return Integer
	 * @hibernate.id column="salesOrderId" type="java.lang.Integer"
	 *               generator-class="native"
	 */
	public Integer getSalesOrderId() {
		return this.salesOrderId;
	}

	/**
	 * Set the salesOrderId
	 */
	public void setSalesOrderId(Integer aValue) {
		this.salesOrderId = aValue;
	}

	/**
	 * 发货地址外键 *
	 * 
	 * @return Integer
	 */
	public Integer getShippingAddressId() {
		return this.getOrderAddress() == null ? null : this.getOrderAddress()
				.getOrderAddressId();
	}

	/**
	 * Set the shippingAddressId
	 */
	public void setShippingAddressId(Integer aValue) {
		if (aValue == null) {
			orderAddress = null;
		} else {
			orderAddress = new OrderAddress(aValue);
			orderAddress.setVersion(Integer.valueOf(0));// set a version to cheat
			// hibernate only
		}
	}

	/**
	 * 订单号 *
	 * 
	 * @return String
	 * @hibernate.property column="orderNo" type="java.lang.String" length="20"
	 *                     not-null="true" unique="false"
	 */
	public String getOrderNo() {
		return this.orderNo;
	}

	/**
	 * Set the orderNo
	 * 
	 * @spring.validator type="required"
	 */
	public void setOrderNo(String aValue) {
		this.orderNo = aValue;
	}

	/**
	 * 购买客户外键 匿名购买则为NULL *
	 * 
	 * @return Integer
	 */
	public Integer getCustomerId() {
		return this.getCustomer() == null ? null : this.getCustomer()
				.getAppuserId();
	}

	/**
	 * Set the customerId
	 */
	public void setCustomerId(Integer aValue) {
		if (aValue == null) {
			customer = null;
		} else {
			customer = new Customer(aValue);
			customer.setVersion(Integer.valueOf(0));// set a version to cheat
			// hibernate only
		}
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	/**
	 * 购买客户账户 *
	 * 
	 * @return String
	 * @hibernate.property column="customerUsername" type="java.lang.String"
	 *                     length="64" not-null="true" unique="false"
	 */
	public String getCustomerUsername() {
		return this.customerUsername;
	}

	/**
	 * Set the customerUsername
	 * 
	 * @spring.validator type="required"
	 */
	public void setCustomerUsername(String aValue) {
		this.customerUsername = aValue;
	}

	/**
	 * 购买客户姓名 *
	 * 
	 * @return String
	 * @hibernate.property column="customerFirstname" type="java.lang.String"
	 *                     length="32" not-null="true" unique="false"
	 */
	public String getCustomerFirstname() {
		return this.customerFirstname;
	}

	/**
	 * Set the customerFirstname
	 * 
	 * @spring.validator type="required"
	 */
	public void setCustomerFirstname(String aValue) {
		this.customerFirstname = aValue;
	}

	/**
	 * 购买客户邮件 *
	 * 
	 * @return String
	 * @hibernate.property column="customerEmail" type="java.lang.String"
	 *                     length="64" not-null="true" unique="false"
	 */
	public String getCustomerEmail() {
		return this.customerEmail;
	}

	/**
	 * Set the customerEmail
	 * 
	 * @spring.validator type="required"
	 */
	public void setCustomerEmail(String aValue) {
		this.customerEmail = aValue;
	}

	/**
	 * 下单后订单总额=商品金额+包装费+运输费+税费-折扣
	 * totalAmount=productCost+wrapCost+shippingCost+tax-discount *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="totalAmount" type="BigDecimal" length="12"
	 *                     not-null="true" unique="false"
	 */
	public BigDecimal getTotalAmount() {
		return this.totalAmount;
	}

	/**
	 * Set the totalAmount
	 * 
	 * @spring.validator type="required"
	 */
	public void setTotalAmount(BigDecimal aValue) {
		this.totalAmount = aValue;
	}

	/**
	 * 已支付金额 注意下单后要考虑（giftCertificatePaid+pointPaid） *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="paidAmount" type="BigDecimal" length="12"
	 *                     not-null="true" unique="false"
	 */
	public BigDecimal getPaidAmount() {
		return this.paidAmount;
	}

	/**
	 * Set the paidAmount
	 * 
	 * @spring.validator type="required"
	 */
	public void setPaidAmount(BigDecimal aValue) {
		this.paidAmount = aValue;
	}

	/**
	 * 商品金额 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="productCost" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getProductCost() {
		return this.productCost;
	}

	/**
	 * Set the productCost
	 */
	public void setProductCost(BigDecimal aValue) {
		this.productCost = aValue;
	}

	/**
	 * 包装费 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="wrapCost" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getWrapCost() {
		return this.wrapCost;
	}

	/**
	 * Set the wrapCost
	 */
	public void setWrapCost(BigDecimal aValue) {
		this.wrapCost = aValue;
	}

	/**
	 * 运输费 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="shippingCost" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getShippingCost() {
		return this.shippingCost;
	}

	/**
	 * Set the shippingCost
	 */
	public void setShippingCost(BigDecimal aValue) {
		this.shippingCost = aValue;
	}

	/**
	 * 税费 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="tax" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getTax() {
		return this.tax;
	}

	/**
	 * Set the tax
	 */
	public void setTax(BigDecimal aValue) {
		this.tax = aValue;
	}

	/**
	 * 折扣 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="discount" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getDiscount() {
		return this.discount;
	}

	/**
	 * Set the discount
	 */
	public void setDiscount(BigDecimal aValue) {
		this.discount = aValue;
	}

	/**
	 * 礼券支付金额 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="giftCertificatePaid" type="BigDecimal"
	 *                     length="12" not-null="false" unique="false"
	 */
	public BigDecimal getGiftCertificatePaid() {
		return this.giftCertificatePaid;
	}

	/**
	 * Set the giftCertificatePaid
	 */
	public void setGiftCertificatePaid(BigDecimal aValue) {
		this.giftCertificatePaid = aValue;
	}

	public BigDecimal getPointPaid() {
		return pointPaid;
	}

	public void setPointPaid(BigDecimal pointPaid) {
		this.pointPaid = pointPaid;
	}

	/**
	 * 使用了的积分 *
	 * 
	 * @return Integer
	 * @hibernate.property column="usedShopPoint" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getUsedShopPoint() {
		return this.usedShopPoint;
	}

	/**
	 * Set the usedShopPoint
	 */
	public void setUsedShopPoint(Integer aValue) {
		this.usedShopPoint = aValue;
	}
	

	
	public String getUsedCouponNo() {
		return usedCouponNo;
	}

	public void setUsedCouponNo(String usedCouponNo) {
		this.usedCouponNo = usedCouponNo;
	}

	/**
	 * 获得的积分 *
	 * 
	 * @return Integer
	 * @hibernate.property column="gainedPoint" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getGainedPoint() {
		return this.gainedPoint;
	}

	/**
	 * Set the gainedPoint
	 */
	public void setGainedPoint(Integer aValue) {
		this.gainedPoint = aValue;
	}
	
	
	

	
	public Integer getGainedPointAtLast() {
		return gainedPointAtLast;
	}

	public void setGainedPointAtLast(Integer gainedPointAtLast) {
		this.gainedPointAtLast = gainedPointAtLast;
	}

	public PromoRule getGainedCouponType() {
		try{
			gainedCouponType.getName();
		}catch(Exception e){
			//有可能已不存在
			return null;
		}
		return gainedCouponType;
	}

	public void setGainedCouponType(PromoRule gainedCouponType) {
		this.gainedCouponType = gainedCouponType;
	}
	
	public Integer getGainedCouponTypeId() {
		return this.getGainedCouponType() == null ? null : this.getGainedCouponType().getPromoRuleId();
	}
	public void setGainedCouponTypeId(Integer aValue) {
		if (aValue == null) {
			gainedCouponType = null;
		} else {
			gainedCouponType = new PromoRule(aValue);
			gainedCouponType.setVersion(Integer.valueOf(0));// set a version to cheat
			// hibernate only
		}
	}


	/**
	 * 订单加价或降价 *
	 * 
	 * @return BigDecimal
	 * @hibernate.property column="premium" type="BigDecimal" length="12"
	 *                     not-null="false" unique="false"
	 */
	public BigDecimal getPremium() {
		return this.premium;
	}

	/**
	 * Set the premium
	 */
	public void setPremium(BigDecimal aValue) {
		this.premium = aValue;
	}

	/**
	 * 是否款到发货 is Cash on Delivery *
	 * 
	 * @return Short
	 * @hibernate.property column="isCod" type="java.lang.Short" length="5"
	 *                     not-null="true" unique="false"
	 */
	public Short getIsCod() {
		return this.isCod;
	}

	/**
	 * Set the isCod
	 * 
	 * @spring.validator type="required"
	 */
	public void setIsCod(Short aValue) {
		this.isCod = aValue;
	}

	/**
	 * 支付方式id，用于前台支付跳转 *
	 * 
	 * @return Integer
	 * @hibernate.property column="paymentMethodId" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getPaymentMethodId() {
		return this.paymentMethodId;
	}

	/**
	 * Set the paymentMethodId
	 */
	public void setPaymentMethodId(Integer aValue) {
		this.paymentMethodId = aValue;
	}
	

	public Short getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(Short paymentType) {
		this.paymentType = paymentType;
	}

	public String getPaymentTypeDesc() {
		return paymentTypeDesc;
	}

	public void setPaymentTypeDesc(String paymentTypeDesc) {
		this.paymentTypeDesc = paymentTypeDesc;
	}

	/**
	 * 是否需要发票 *
	 * 
	 * @return Short
	 * @hibernate.property column="hasInvoice" type="java.lang.Short" length="5"
	 *                     not-null="true" unique="false"
	 */
	public Short getHasInvoice() {
		return this.hasInvoice;
	}

	/**
	 * Set the hasInvoice
	 * 
	 * @spring.validator type="required"
	 */
	public void setHasInvoice(Short aValue) {
		this.hasInvoice = aValue;
	}

	/**
	 * 发票抬头 *
	 * 
	 * @return String
	 * @hibernate.property column="invoiceTitle" type="java.lang.String"
	 *                     length="128" not-null="false" unique="false"
	 */
	public String getInvoiceTitle() {
		return this.invoiceTitle;
	}

	/**
	 * Set the invoiceTitle
	 */
	public void setInvoiceTitle(String aValue) {
		this.invoiceTitle = aValue;
	}

	/**
	 * 包装外键，不使用包装即为NULL *
	 * 
	 * @return Integer
	 * @hibernate.property column="wrapId" type="java.lang.Integer" length="10"
	 *                     not-null="false" unique="false"
	 */
	public Integer getWrapId() {
		return this.wrapId;
	}

	/**
	 * Set the wrapId
	 */
	public void setWrapId(Integer aValue) {
		this.wrapId = aValue;
	}

	/**
	 * 包装名称 *
	 * 
	 * @return String
	 * @hibernate.property column="wrapName" type="java.lang.String" length="64"
	 *                     not-null="false" unique="false"
	 */
	public String getWrapName() {
		return this.wrapName;
	}

	/**
	 * Set the wrapName
	 */
	public void setWrapName(String aValue) {
		this.wrapName = aValue;
	}

	/**
	 * 包装祝福语 *
	 * 
	 * @return String
	 * @hibernate.property column="wrapNote" type="java.lang.String"
	 *                     length="512" not-null="false" unique="false"
	 */
	public String getWrapNote() {
		return this.wrapNote;
	}

	/**
	 * Set the wrapNote
	 */
	public void setWrapNote(String aValue) {
		this.wrapNote = aValue;
	}

	/**
	 * 客户留言 *
	 * 
	 * @return String
	 * @hibernate.property column="remark" type="java.lang.String" length="256"
	 *                     not-null="false" unique="false"
	 */
	public String getRemark() {
		return this.remark;
	}

	/**
	 * Set the remark
	 */
	public void setRemark(String aValue) {
		this.remark = aValue;
	}

	/**
	 * 订单备注 *
	 * 
	 * @return String
	 * @hibernate.property column="memo" type="java.lang.String" length="1024"
	 *                     not-null="false" unique="false"
	 */
	public String getMemo() {
		return this.memo;
	}

	/**
	 * Set the memo
	 */
	public void setMemo(String aValue) {
		this.memo = aValue;
	}

	public String getCancelReason() {
		return cancelReason;
	}

	public void setCancelReason(String cancelReason) {
		this.cancelReason = cancelReason;
	}

	/**
	 * ip地址 *
	 * 
	 * @return String
	 * @hibernate.property column="ipAddress" type="java.lang.String"
	 *                     length="64" not-null="false" unique="false"
	 */
	public String getIpAddress() {
		return this.ipAddress;
	}

	/**
	 * Set the ipAddress
	 */
	public void setIpAddress(String aValue) {
		this.ipAddress = aValue;
	}

	/**
	 * 标签 *
	 * 
	 * @return String
	 * @hibernate.property column="tags" type="java.lang.String" length="65535"
	 *                     not-null="false" unique="false"
	 */
	public String getTags() {
		return this.tags;
	}

	/**
	 * Set the tags
	 */
	public void setTags(String aValue) {
		this.tags = aValue;
	}
	
	

	public Integer getShippingRateId() {
		return shippingRateId;
	}

	public void setShippingRateId(Integer shippingRateId) {
		this.shippingRateId = shippingRateId;
	}

	/**
	 * 运输方式id *
	 * 
	 * @return Integer
	 * @hibernate.property column="shippingMethodId" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getShippingMethodId() {
		return this.shippingMethodId;
	}

	/**
	 * Set the shippingMethodId
	 */
	public void setShippingMethodId(Integer aValue) {
		this.shippingMethodId = aValue;
	}

	/**
	 * 配送方式描述，例如货到付款等 *
	 * 
	 * @return String
	 * @hibernate.property column="deliveryType" type="java.lang.String"
	 *                     length="256" not-null="false" unique="false"
	 */
	public String getDeliveryTypeDesc() {
		return this.deliveryTypeDesc;
	}

	/**
	 * Set the deliveryType
	 */
	public void setDeliveryTypeDesc(String aValue) {
		this.deliveryTypeDesc = aValue;
	}

	/**
	 * 送货时间 *
	 * 
	 * @return String
	 * @hibernate.property column="deliveryTime" type="java.lang.String"
	 *                     length="32" not-null="false" unique="false"
	 */
	public String getDeliveryTime() {
		return this.deliveryTime;
	}

	/**
	 * Set the deliveryTime
	 */
	public void setDeliveryTime(String aValue) {
		this.deliveryTime = aValue;
	}

	public Short getNeedConfrimB4Delivery() {
		return needConfrimB4Delivery;
	}

	public void setNeedConfrimB4Delivery(Short needConfrimB4Delivery) {
		this.needConfrimB4Delivery = needConfrimB4Delivery;
	}

	/**
	 * 客户取货中心ID *
	 * 
	 * @return Integer
	 * @hibernate.property column="selfCollectionCentreId"
	 *                     type="java.lang.Integer" length="10" not-null="false"
	 *                     unique="false"
	 */
	public Integer getSelfCollectionCentreId() {
		return this.selfCollectionCentreId;
	}

	/**
	 * Set the selfCollectionCentreId
	 */
	public void setSelfCollectionCentreId(Integer aValue) {
		this.selfCollectionCentreId = aValue;
	}

	/**
	 * 客户取货中心名称 *
	 * 
	 * @return String
	 * @hibernate.property column="selfCollectionCentreName"
	 *                     type="java.lang.String" length="64" not-null="false"
	 *                     unique="false"
	 */
	public String getSelfCollectionCentreName() {
		return this.selfCollectionCentreName;
	}

	/**
	 * Set the selfCollectionCentreName
	 */
	public void setSelfCollectionCentreName(String aValue) {
		this.selfCollectionCentreName = aValue;
	}

	/**
	 * 要求提货日期 *
	 * 
	 * @return Date
	 * @hibernate.property column="exceptedSelfCollectDate" type="Date"
	 *                     length="19" not-null="false" unique="false"
	 */
	public Date getExceptedSelfCollectDate() {
		return this.exceptedSelfCollectDate;
	}

	/**
	 * Set the exceptedSelfCollectDate
	 */
	public void setExceptedSelfCollectDate(Date aValue) {
		this.exceptedSelfCollectDate = aValue;
	}

	/**
	 * 实际提货日期 *
	 * 
	 * @return Date
	 * @hibernate.property column="actualSelfCollectDate" type="Date"
	 *                     length="19" not-null="false" unique="false"
	 */
	public Date getActualSelfCollectDate() {
		return this.actualSelfCollectDate;
	}

	/**
	 * Set the actualSelfCollectDate
	 */
	public void setActualSelfCollectDate(Date aValue) {
		this.actualSelfCollectDate = aValue;
	}

	/**
	 * 订单来源，1-网上订购 2-代客下单 *
	 * 
	 * @return Short
	 * @hibernate.property column="orderSource" type="java.lang.Short"
	 *                     length="5" not-null="false" unique="false"
	 */
	public Short getOrderSource() {
		return this.orderSource;
	}

	/**
	 * Set the orderSource
	 */
	public void setOrderSource(Short aValue) {
		this.orderSource = aValue;
	}

	/**
	 * 订单基础状态 *
	 * 
	 * @return Short
	 * @hibernate.property column="orderStatus" type="java.lang.Short"
	 *                     length="5" not-null="true" unique="false"
	 */
	public Short getOrderStatus() {
		return this.orderStatus;
	}

	/**
	 * Set the orderStatus
	 * 
	 * @spring.validator type="required"
	 */
	public void setOrderStatus(Short aValue) {
		this.orderStatus = aValue;
	}

	/**
	 * 支付状态 *
	 * 
	 * @return Short
	 * @hibernate.property column="paymentStatus" type="java.lang.Short"
	 *                     length="5" not-null="true" unique="false"
	 */
	public Short getPaymentStatus() {
		return this.paymentStatus;
	}

	/**
	 * Set the paymentStatus
	 * 
	 * @spring.validator type="required"
	 */
	public void setPaymentStatus(Short aValue) {
		this.paymentStatus = aValue;
	}

	/**
	 * 发货状态 *
	 * 
	 * @return Short
	 * @hibernate.property column="shipmentStatus" type="java.lang.Short"
	 *                     length="5" not-null="true" unique="false"
	 */
	public Short getShipmentStatus() {
		return this.shipmentStatus;
	}

	/**
	 * Set the shipmentStatus
	 * 
	 * @spring.validator type="required"
	 */
	public void setShipmentStatus(Short aValue) {
		this.shipmentStatus = aValue;
	}

	/**
	 * 1=已打印 *
	 * 
	 * @return Short
	 * @hibernate.property column="isPrinted" type="java.lang.Short" length="5"
	 *                     not-null="false" unique="false"
	 */
	public Short getIsPrinted() {
		return this.isPrinted;
	}

	/**
	 * Set the isPrinted
	 */
	public void setIsPrinted(Short aValue) {
		this.isPrinted = aValue;
	}

	/**
	 * *
	 * 
	 * @return Date
	 * @hibernate.property column="createTime" type="Date" length="19"
	 *                     not-null="true" unique="false"
	 */
	public Date getCreateTime() {
		return this.createTime;
	}

	/**
	 * Set the createTime
	 * 
	 * @spring.validator type="required"
	 */
	public void setCreateTime(Date aValue) {
		this.createTime = aValue;
	}

	/**
	 * *
	 * 
	 * @return Date
	 * @hibernate.property column="updateTime" type="Date" length="19"
	 *                     not-null="true" unique="false"
	 */
	public Date getUpdateTime() {
		return this.updateTime;
	}

	/**
	 * Set the updateTime
	 * 
	 * @spring.validator type="required"
	 */
	public void setUpdateTime(Date aValue) {
		this.updateTime = aValue;
	}

	/**
	 * *
	 * 
	 * @return Integer
	 * @hibernate.property column="createBy" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getCreateBy() {
		return this.createBy;
	}

	/**
	 * Set the createBy
	 */
	public void setCreateBy(Integer aValue) {
		this.createBy = aValue;
	}

	/**
	 * *
	 * 
	 * @return Integer
	 * @hibernate.property column="updateBy" type="java.lang.Integer"
	 *                     length="10" not-null="false" unique="false"
	 */
	public Integer getUpdateBy() {
		return this.updateBy;
	}

	/**
	 * Set the updateBy
	 */
	public void setUpdateBy(Integer aValue) {
		this.updateBy = aValue;
	}

	/**
	 * *
	 * 
	 * @return Integer
	 * @hibernate.property column="version" type="java.lang.Integer" length="10"
	 *                     not-null="true" unique="false"
	 */
	public Integer getVersion() {
		return this.version;
	}

	/**
	 * Set the version
	 * 
	 * @spring.validator type="required"
	 */
	public void setVersion(Integer aValue) {
		this.version = aValue;
	}

	/**
	 * @see java.lang.Object#equals(Object)
	 */
	public boolean equals(Object object) {
		if (!(object instanceof SalesOrderTbl)) {
			return false;
		}
		SalesOrderTbl rhs = (SalesOrderTbl) object;
		return new EqualsBuilder()
				.append(this.salesOrderId, rhs.salesOrderId)
				.append(this.orderNo, rhs.orderNo)
				.append(this.customerUsername, rhs.customerUsername)
				.append(this.customerFirstname, rhs.customerFirstname)
				.append(this.customerEmail, rhs.customerEmail)
				.append(this.totalAmount, rhs.totalAmount)
				.append(this.paidAmount, rhs.paidAmount)
				.append(this.productCost, rhs.productCost)
				.append(this.wrapCost, rhs.wrapCost)
				.append(this.shippingCost, rhs.shippingCost)
				.append(this.tax, rhs.tax)
				.append(this.discount, rhs.discount)
				.append(this.giftCertificatePaid, rhs.giftCertificatePaid)
				.append(this.pointPaid, rhs.pointPaid)
				.append(this.usedShopPoint, rhs.usedShopPoint)
				.append(this.gainedPoint, rhs.gainedPoint)
				.append(this.premium, rhs.premium)
				.append(this.isCod, rhs.isCod)
				.append(this.paymentMethodId, rhs.paymentMethodId)
				.append(this.paymentType, rhs.paymentType)
				.append(this.hasInvoice, rhs.hasInvoice)
				.append(this.invoiceTitle, rhs.invoiceTitle)
				.append(this.wrapId, rhs.wrapId)
				.append(this.wrapName, rhs.wrapName)
				.append(this.wrapNote, rhs.wrapNote)
				.append(this.remark, rhs.remark)
				.append(this.memo, rhs.memo)
				.append(this.ipAddress, rhs.ipAddress)
				.append(this.tags, rhs.tags)
				.append(this.shippingMethodId, rhs.shippingMethodId)
				.append(this.deliveryTypeDesc, rhs.deliveryTypeDesc)
				.append(this.deliveryTime, rhs.deliveryTime)
				.append(this.needConfrimB4Delivery, rhs.needConfrimB4Delivery)
				.append(this.selfCollectionCentreId, rhs.selfCollectionCentreId)
				.append(this.selfCollectionCentreName,
						rhs.selfCollectionCentreName).append(
						this.exceptedSelfCollectDate,
						rhs.exceptedSelfCollectDate).append(
						this.actualSelfCollectDate, rhs.actualSelfCollectDate)
				.append(this.orderSource, rhs.orderSource).append(
						this.orderStatus, rhs.orderStatus).append(
						this.paymentStatus, rhs.paymentStatus).append(
						this.shipmentStatus, rhs.shipmentStatus).append(
						this.isPrinted, rhs.isPrinted).append(this.createTime,
						rhs.createTime).append(this.updateTime, rhs.updateTime)
				.append(this.createBy, rhs.createBy).append(this.updateBy,
						rhs.updateBy).append(this.version, rhs.version)
				.isEquals();
	}

	/**
	 * @see java.lang.Object#hashCode()
	 */
	public int hashCode() {
		return new HashCodeBuilder(-82280557, -700257973).append(
				this.salesOrderId).append(this.orderNo).append(
				this.customerUsername).append(this.customerFirstname).append(
				this.customerEmail).append(this.totalAmount).append(
				this.paidAmount).append(this.productCost).append(this.wrapCost)
				.append(this.shippingCost).append(this.tax).append(
						this.discount).append(this.giftCertificatePaid).append(
						this.pointPaid).append(this.usedShopPoint).append(this.premium).append(this.isCod).append(
						this.paymentMethodId).append(this.paymentType).append(
						this.hasInvoice).append(this.invoiceTitle).append(
						this.wrapId).append(this.wrapName)
				.append(this.wrapNote).append(this.remark).append(this.memo)
				.append(this.ipAddress).append(this.tags).append(
						this.shippingMethodId).append(this.deliveryTypeDesc)
				.append(this.deliveryTime).append(this.needConfrimB4Delivery)
				.append(this.selfCollectionCentreId).append(
						this.selfCollectionCentreName).append(
						this.exceptedSelfCollectDate).append(
						this.actualSelfCollectDate).append(this.orderSource)
				.append(this.orderStatus).append(this.paymentStatus).append(
						this.shipmentStatus).append(this.isPrinted).append(
						this.createTime).append(this.updateTime).append(
						this.createBy).append(this.updateBy).append(
						this.version).toHashCode();
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this)
				.append("salesOrderId", this.salesOrderId)
				.append("orderNo", this.orderNo)
				.append("customerUsername", this.customerUsername)
				.append("customerFirstname", this.customerFirstname)
				.append("customerEmail", this.customerEmail)
				.append("totalAmount", this.totalAmount)
				.append("paidAmount", this.paidAmount)
				.append("productCost", this.productCost)
				.append("wrapCost", this.wrapCost)
				.append("shippingCost", this.shippingCost)
				.append("tax", this.tax)
				.append("discount", this.discount)
				.append("giftCertificatePaid", this.giftCertificatePaid)
				.append("pointPaid", this.pointPaid)
				.append("usedShopPoint", this.usedShopPoint)
				.append("gainedPoint", this.gainedPoint)
				.append("premium", this.premium)
				.append("isCod", this.isCod)
				.append("paymentMethodId", this.paymentMethodId)
				.append("paymentType", this.paymentType)
				.append("hasInvoice", this.hasInvoice)
				.append("invoiceTitle", this.invoiceTitle)
				.append("wrapId", this.wrapId)
				.append("wrapName", this.wrapName)
				.append("wrapNote", this.wrapNote)
				.append("remark", this.remark)
				.append("memo", this.memo)
				.append("ipAddress", this.ipAddress)
				.append("tags", this.tags)
				.append("shippingMethodId", this.shippingMethodId)
				.append("deliveryType", this.deliveryTypeDesc)
				.append("deliveryTime", this.deliveryTime)
				.append("needConfrimB4Delivery", this.needConfrimB4Delivery)
				.append("selfCollectionCentreId", this.selfCollectionCentreId)
				.append("selfCollectionCentreName",
						this.selfCollectionCentreName)
				.append("exceptedSelfCollectDate", this.exceptedSelfCollectDate)
				.append("actualSelfCollectDate", this.actualSelfCollectDate)
				.append("orderSource", this.orderSource).append("orderStatus",
						this.orderStatus).append("paymentStatus",
						this.paymentStatus).append("shipmentStatus",
						this.shipmentStatus)
				.append("isPrinted", this.isPrinted).append("createTime",
						this.createTime).append("updateTime", this.updateTime)
				.append("createBy", this.createBy).append("updateBy",
						this.updateBy).append("version", this.version)
				.toString();
	}

	/**
	 * Return the name of the first key column
	 */
	public String getFirstKeyColumnName() {
		return "salesOrderId";
	}

	/**
	 * Return the Id (pk) of the entity, must be Integer
	 */
	public Integer getId() {
		return salesOrderId;
	}

}